package gevis.common.lib;


import gevis.code.CODE_ERR;
import gevis.common.LIB_CALL_COMMON;
import gevis.common.dto.Combuf;

public abstract class L_COMMON<DATA extends Combuf> extends LIB_CALL_COMMON<DATA>
{	
	protected abstract CODE_ERR init(DATA combuf);
	
	protected abstract CODE_ERR process(DATA combuf);
	
	protected abstract CODE_ERR finish(DATA combuf);
	
	public CODE_ERR Start(DATA combuf)
	{
		CODE_ERR reval = CODE_ERR.NONE;
		
		reval = this.init(combuf);
		if(reval != CODE_ERR.NONE) return reval;
		
		reval = this.process(combuf);
		if(reval != CODE_ERR.NONE) return reval;
		
		reval = this.finish(combuf);
		if(reval != CODE_ERR.NONE) return reval;
		return reval;
	}
}
